#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 1e6 + 10;
int arr[N];
int k[2010];
int kind;
int main()
{
    int m, n; cin >> n >> m;
    int mleft = 0, mright = 0, ret = 0x3f3f3f3f;
    for (int i = 0; i < n; i++)
        cin >> arr[i];
    for (int left = 0, right = 0; right < n; right++)
    {
        if (!k[arr[right]]) kind++;
        k[arr[right]]++;
        while (kind == m)
        {
            if (right - left + 1 < ret)
            {
                mleft = left, mright = right;
                ret = right - left + 1;
            }
            k[arr[left]]--;
            if (!k[arr[left]]) kind--;
            left++;
        }
    }
    cout << mleft + 1 << mright + 1 << endl;
    return 0;
}